#While循环输出两种99乘法表      
print("While循环输出两种99乘法表")
 
i=1
while i<10:
    j=k=1
    while j<=i:
        if k<=9-i:
            print(" "*9,end="")
            k+=1
            continue
        else:
            print("{}*{}={:<5d}".format(j,i,i*j),end="")          
        
        j+=1        
    i+=1
    print('\n')
print("="*80)

i=9
while i>0:
    j=k=1
    while j<=i:
        if k<=9-i:
            print(" "*9,end="")
            k+=1
            continue
        else:
            print("{}*{}={:<5d}".format(j,i,i*j),end="")          
        
        j+=1        
    i-=1
    print('\n')
print("="*80)



#for循环输出两种99乘法表
print("for循环输出两种99乘法表")
for i in range(1,10):
    for kk in range(9):
        if kk<9-i :
            print(" "*9,end="")
            continue
        else:
            for j in range(1,i+1):
                print("{}*{}={:<5d}".format(j,i,i*j),end="")
            break
    print('\n')
print("="*80)
               

for i in range(9,0,-1):
    for kk in range(9):
        if kk<9-i :
            print(" "*9,end="")
            continue
        else:
            for j in range(1,i+1):
                print("{}*{}={:<5d}".format(j,i,i*j),end="")
            break
    print('\n')
print("="*80)




'''

for i in range(1,10):   
    for j in range(1,i+1):
        for kk in range(9):
            if kk<9-i:
                print(" "*9,end="")
                continue
            else:
                print("{}*{}={:<5d}".format(j,i,i*j),end="")
                break
        
    print('\n')
'''
